package com.chen.facemanager;

import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;

/**
 * @ClassName T2
 * @Description
 * @Author Mr-CHEN
 * @Date 2019/8/26 14:40
 * @Version V1.0
 **/

public class T2 {
    public static void main(String[] args) throws ClassNotFoundException, NoSuchFieldException, IllegalAccessException, NoSuchMethodException, InvocationTargetException, InstantiationException {
        Class<?> ewm = Class.forName("com.chen.facemanager.EWM");
        Constructor<?> constructor = ewm.getConstructor();
        Object o = constructor.newInstance();

        Field id = ewm.getField("id");
        id.set(o,"123");

        System.out.println(ewm);
        System.out.println(o);
    }
}